<template>
	<div class="lietou-detail content">
		<div class="detail-bg"></div>
		<div class="lietou-right">
			<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />

			<div class="lietou-detail-head">
				<h2 class="lietou-detail-h1">分佣调整记录</h2>
				<el-table header-row-class-name="my-table-header" :data="tableData" class="answerTable"
				 :header-cell-style="{ background: '#eee',color:'#555555'}" stripe :row-style="{height:'48px'}"
				 :highlight-current-row="true">
					<el-table-column fixed type="index" label="序列" width="100" column-key="id" align="center"></el-table-column>
					<el-table-column prop="date" label="分佣修改时间"></el-table-column>
					<el-table-column prop="company" label="分佣比例"></el-table-column>
				</el-table>
				<el-row type="flex" class="row-bg" justify="center" v-show="pageCount>1">
					<el-col :span="24" style="text-align:center;margin-top:50px">
						<el-pagination background layout="prev, pager, next" :page-size="pageSize" :page-count="pageCount" :current-page="pageNo"
						 @current-change="pageChange">
						</el-pagination>
					</el-col>
				</el-row>
			</div>
		</div>
	</div>
</template>

<script>
	import { mapGetters } from 'vuex'
	import Breadcrumb from '@/components/Breadcrumb'
	export default {
		name: 'CityChangeHistory',
		components:{
			Breadcrumb
		},
		data() {
			return {
				searchPhone: '',
				nickname:'',
				tableData: [{
					date:'2020-05-02',
					id:'205555',
					company:'这是一个公司名称',
					phone:'153222225565',
					number:56
				},{
					date:'2020-05-02',
					id:'205555',
					company:'这是一个公司名称',
					phone:'153222225565',
					number:56
				},{
					date:'2020-05-02',
					id:'205555',
					company:'这是一个公司名称',
					phone:'153222225565',
					number:56
				},{
					date:'2020-05-02',
					id:'205555',
					company:'这是一个公司名称',
					phone:'153222225565',
					number:56
				}], //表格数据
				pageCount: 0,
				pageNo: 1,
				pageSize: 10,
				state: '1',
				 url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
			}
		},
		watch:{
		  //  '$route': function(newUrl,oldUrl){
				// if(oldUrl.name=='lietouList'){ //详情页面返回的
				// 	if(oldUrl.params.refresh){
				// 	  this.loadData();
				// 	}
				// }
		  //  }
		},
		async created() {
		   // this.loadData();
		},
		methods:{
			// 搜索
			searchData(){
				this.pageNo=1;
				this.loadData();
			},
			//分页
			pageChange(val) {
			  this.pageNo = val;
			  this.loadData()
			},
			async loadData() {
			  const loading = this.$loading({
			    lock: true,
			    text: 'Loading',
			    spinner: 'el-icon-loading',
			    background: 'rgba(0, 0, 0, 0.5)'
			  });
			  try {
			   let data = {
			      "type": this.type,
			      "content": this.title,
			      "phone": this.phone,//手机号
			      "state": this.isAnswer,

			      "start_create_date": this.createDate!=null ? this.createDate[0]:'',//时间范围开始时间
			      "end_create_date": this.createDate!=null? this.createDate[1]: '',//时间范围结束时间
			      "pageNo": this.pageNo,//分页页码
			      "pageSize": this.pageSize,//分页每页数量
			    }
			    let res = await this.$http({
			      url: 'disposefeedbackList',
			      method: 'post',
			      data: data
			    });
			    let tData = res.feedbackPage;
			    this.pageCount = tData.pages; //总页数
			    this.pageNo = tData.pageNum; //当前页 size当前页
			    this.tableData = tData.list;

			    loading.close();
			  } catch (e) {
			    console.log(e)
			    loading.close();
			  }
			},
		}
	}
</script>

<style lang="scss" scoped="scoped">
	.el-button.buttonStyle{
	  height: 32px;
	  font-size: 14px;
	  font-family: PingFangSC-Medium, PingFang SC;
	  font-weight: 500;
	  color: #FFFFFF;
	  background:#3674FF;
	  border-radius: 5px;
	  border:0;
	  margin-left:6px;
	  margin-top:2px;
	}
	.answerTable{
		margin-top:15px;
		margin:0 auto;
		width:96%;
	}
	.lietou-detail-h1{
		font-size:18px;
		font-weight: bold;
		padding:20px 16px 6px;
	}
	.lietou-detail{
		background-color: rgb(240, 242, 245);
		position: relative;

		.detail-bg {
		  position: fixed;
		  top: 0px;
		  left: 0;
		  bottom:0;
		  right: 0;
		  background: #f4f4f4;
		}

	}
	.lietou-detail-head{
		background-color: #fff;
		margin:0 0 20px 0px;
		padding-bottom:25px;
		position: relative;
		min-width:800px;
	}
</style>
